import Cookies from 'js-cookie'

const TokenKey = 'JSESSIONID'

export function setUserName( userName ){
    Cookies.set('rs-login-username',userName,{ path: '' })
}

export function removeUserName(){
    Cookies.remove('rs-login-username',{ path: '' })
}

export function getUserName(){
    return Cookies.get('rs-login-username',{ path: '' })
}

export function getToken() {

    console.log(Cookies.get())
  const key = Cookies.get(TokenKey)
  console.log(key)
  return key;
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
